<?php
    include_once "checkAdmin.php";
?>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<?php
$id = $_GET['id'];
include "conn.php";
if(mysqli_query($conn,"delete from object where id=$id")){
    echo "<script>alert('删除成功！');location.href='admin.php';</script>";
}
else{
    $msg = "删除失败！";
    /*echo mysqli_error($conn);
    exit;*/
    echo "<script>alert(\"$msg\");history.back();</script>";
}
?>

</body>
</html>